package com.tianlan.blog.entity;

import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


@ApiModel(value = "Log对象", description = "")
@Entity
@Table( name = "sys_log")
@EntityListeners(AuditingEntityListener.class)
@DynamicInsert
@DynamicUpdate( value = true)
public class SysLog{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "接口名称")
    @Column(name = "method_name")
    private String methodName;

    @ApiModelProperty(value = "入参")
    @Column(name = "in_params")
    private String inParams;

    @ApiModelProperty(value = "出参")
    @Column(name = "out_params")
    private String outParams;

    @ApiModelProperty(value = "日志类型")
    @Column(name = "log_type")
    private String logType;

    @ApiModelProperty(value = "操作名称")
    @Column(name = "operation_name")
    private String operationName;

    @ApiModelProperty(value = "操作的IP")
    @Column(name = "operation_ip")
    private String operationIp;

    @ApiModelProperty(value = "创建日期")
    @Column(name = "create_time")
    @CreatedDate
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建者")
    @Column(name = "creator")
    @CreatedBy
    private Integer creator;

    @ApiModelProperty(value = "更新日期")
    @Column(name = "update_time")
    @LastModifiedDate
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "更新者")
    @Column(name = "operator")
    @LastModifiedBy
    private Integer operator;

    @ApiModelProperty(value = "1:删除 0:不删除")
    @Column(name = "del_flag")
    private String delFlag;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getInParams() {
        return inParams;
    }

    public void setInParams(String inParams) {
        this.inParams = inParams;
    }

    public String getOutParams() {
        return outParams;
    }

    public void setOutParams(String outParams) {
        this.outParams = outParams;
    }

    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType;
    }

    public String getOperationName() {
        return operationName;
    }

    public void setOperationName(String operationName) {
        this.operationName = operationName;
    }

    public String getOperationIp() {
        return operationIp;
    }

    public void setOperationIp(String operationIp) {
        this.operationIp = operationIp;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Integer getCreator() {
        return creator;
    }

    public void setCreator(Integer creator) {
        this.creator = creator;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getOperator() {
        return operator;
    }

    public void setOperator(Integer operator) {
        this.operator = operator;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Override
    public String toString() {
        return "Log{" + "id=" + id + ", methodName=" + methodName + ", inParams=" + inParams + ", outParams="
                + outParams + ", logType=" + logType + ", operationName=" + operationName + ", operationIp="
                + operationIp + ", createTime=" + createTime + ", creator=" + creator + ", updateTime=" + updateTime
                + ", operator=" + operator + ", delFlag=" + delFlag + "}";
    }
}
